'use strict';

function amount_even(collection) {
  let arr = [];
  for(let item of collection){
    if(item%2 === 0){
      arr.push(item);
    }
  }
  let result = arr.reduce(function(prevision,current){
    return prevision+current;
  });
  console.log(result);
  return result;
  //在这里写入代码
}
amount_even( [1,2,3,4,5,6,7,8,9,10]);
module.exports = amount_even;
